<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
        function sortcompare(val1,val2){
        	if (val1<val2) {
        		return -1;
        	}else if(val1==val2){
        		return 0;
        	}else if (val1>val2) {
        		return 1;
        	}

        } 

		var box=[11,15,8,6,14,7,6,1,3,2,81];
		alert(box.sort(sortcompare).reverse().join(" "))
	</script>
</body>
</html>